package com.framework.modules.base.service;

import com.baomidou.mybatisplus.service.IService;
import com.framework.common.sms.SmsResponse;
import com.framework.common.utils.PageUtils;
import com.framework.modules.base.entity.ValidateCodeEntity;

import java.util.Map;

/**
 * 系统验证码表 存储手机或其他的验证信息
 *
 * @author MIT
 * @email litmiss@gmail.com
 * @date 2020-10-12 10:45:15
 */
public interface ValidateCodeService extends IService<ValidateCodeEntity> {

    PageUtils queryPage(Map<String, Object> params);

    ValidateCodeEntity getLastValidCodeEntry(String mobile,Integer exprirdTimeStamp);

    Integer checkCodeCount(String mobile,Integer start,Integer end);

    Integer checkDailyCodeCount(String mobile);

    SmsResponse sendValidateCode(String mobs, String validateCode);

    /**
     * 更新短信状态
     * @param id
     * @param state
     * @return
     */
    Integer updateState(Integer id,Integer state);
}

